<template>
<div>
    <!-- <button :class="'i-button-size' + size" :disabled="disabled">
        <slot name="icon"></slot>
        <slot>提交</slot>
    </button> -->

    <button @click="handleClick">
        <slot>提交</slot>
    </button>

</div>
</template>
<script>
 function oneOf(value, validList) {
    for(let i = 0; i < validList.length; i++){
        if(value === validList[i]){
            return true;
        }
    } 
    return false;
}
export default {
   data(){
       return{
          
       }
   },
   //配置项
   props: {
       size:{
           validator (value) {
               return oneOf(value, ['small', 'large', 'default']);
           },
           default: 'default'
       },
       disabled:{
           type: Boolean,
           default: false
       },
     
   },
   methods:{
       //给组件添加自定义事件
       handleClick(event){
           this.$emit('on-click', event);
       }
   }
}
</script>
<style lang="css">
    
</style>
    
